require("./ad.css");
window.addEventListener("load", function () {
	// 获取选择器
	function $(v) {
		if (v.startsWith("#")) {
			return document.querySelector(v);
		} else {
			return document.querySelectorAll(v);
		}
	}
	// 倒计时
	let time = 5;
	let timer = setInterval(() => {
		time--;
		$("#nmb").textContent = `${time}`;
		console.log($("#nmb"));
		if (time < 0) {
			clearInterval(timer);
			$("#nmb").textContent = ``;
			location.assign("./log-in.html");
		}
		// 跳过按钮
		$("#zapping").addEventListener("click", function () {
			location.assign("./log-in.html");
		});
		$("#words").addEventListener("click", function () {
			location.assign("./log-in.html");
		});
	}, 1000);
});
